SPB Git forge
38commits 1branches 0releases
338.7 MBsize
maindefault branch
6 h agolast push
HTML 53.9% TypeScript 44.5% JavaScript 0.6% SQL 0.5%
608 B · 15 lines tsx
Raw Blame History
1import { notFound } from "next/navigation";2import type { ReactNode } from "react";3import { getProject } from "./data";45/**6 * Existence gate for /projects/[slug]: resolves the project before this segment's loading boundary streams,7 * so an unknown slug is a real 404 (not a soft one). Other API failures fall through to the page.8 */9export default async function ProjectLayout({ children, params }: { children: ReactNode; params: Promise<{ slug: string }> }) {10  const { slug } = await params;11  const r = await getProject(slug);12  if (!r.ok && r.status === 404) notFound();13  return <>{children}</>;14}15